xen/libcx/tmem: Replace TMEM_RESTORE_NEW with XEN_SYSCTL_TMEM_OP_SET_POOLS
authorKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Mon, 28 Nov 2016 06:10:50 +0000 (01:10 -0500)
committerKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Wed, 5 Apr 2017 13:35:41 +0000 (09:35 -0400)
commit8cd9fa11e106104a6df2e4c670d512bb4f239845
treec0e0a87378abd12f30ae17cf2dfb9c903432f887
parent3c3de0ee7a450a7e7dae6115089f72409971d041
xen/libcx/tmem: Replace TMEM_RESTORE_NEW with XEN_SYSCTL_TMEM_OP_SET_POOLS

This used to be done under TMEM_RESTORE_NEW which was an hypercall
accessible by the guest. However there are couple of reasons
not to do it:
 - No checking of domid on TMEM_RESTORE_NEW which meant that
   any guest could create TMEM pools for other guests.
 - The guest can already create pools using TMEM_NEW_POOL
   (which is limited to guest doing the hypercall)
 - This functionality is only needed during migration - there
   is no need for the guest to have this functionality.

However to move this we also have to allocate the 'struct domain'
->tmem pointer. It is by default set to NULL and would be initialized
via the guest do_tmem() hypercalls. Presumarily that was the
initial reason that TMEM_RESTORE_NEW was in the guest accessible
hypercalls.

Acked-by: Wei Liu <wei.liu2@citrix.com> [libxc change]
Reviewed-by: Jan Beulich <jbeulich@suse.com> [hypervisor changes]
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
tools/libxc/xc_tmem.c
xen/common/tmem.c
xen/common/tmem_control.c
xen/include/public/sysctl.h
xen/include/public/tmem.h
xen/include/xen/tmem_control.h
xen/include/xen/tmem_xen.h